/*
 * layout
 */
define(function(require) {
	var comm = require('sdk/server');
	require('sdk/common');

	appcan.ready(function() {
		//关闭后台页面
		appcan.window.publish('closeback','closeback');

		//首页禁止返回
		appcan.window.monitorKey(0,function(){
			appcan.ls.remove('notice');
			appcan.ls.remove('referrer');
			setTimeout(function() {
				uexWidgetOne.exit();
			}, 0);
		});

		//banner
		var dataImg = [{
				content: 'http://temp.im/600x300/'
			}, {
				content: 'http://temp.im/600x300/'
			}, {
				content: 'http://temp.im/600x300/'
			}],
			partSlide,
			slideFunc = function() {
				partSlide = new iSlider({
					dom: document.getElementById('banner'),
					data: dataImg,
					isLooping: true,
					isAutoplay: false,
					plugins: ['dot']
				});
			};

		if (dataImg.length) {
			$('#slideWrap').removeClass('hide');
			$.each(dataImg, function(i, e) {
				e.content = comm.source(e.content);
			});
			if (window.iSlider) {
				slideFunc();
			} else {
				appcan.getScript('lib/islider', function() {
					slideFunc();
				}, {
					css: true
				});
			}
		} else {
			$('#slideWrap').addClass('hide');
		};

	});
});